package Igraf;

import javax.swing.DefaultListModel;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import javax.swing.SwingConstants;

import java.awt.BorderLayout;
import java.awt.Choice;
import java.awt.Font;
import java.awt.GridLayout;
import java.awt.SystemColor;
import java.awt.FlowLayout;
import javax.swing.JComboBox;
import javax.swing.ListSelectionModel;

public class panelKontsulta extends JPanel{
	
	private DefaultListModel datuLista = new DefaultListModel();
	private JList listaEventos = new JList(datuLista);
	private JScrollPane scrollLista = new JScrollPane(listaEventos);
	private JLabel hautatu,bilaketa;
	private JTextField bil;
	private JButton atzera,bilatu;
	private JComboBox comboBox;
	
	public panelKontsulta() {
		
		setBackground(SystemColor.activeCaption);
		setLayout(new BorderLayout());
		
		JPanel erdikoa = new JPanel();
		erdikoa.setBackground(SystemColor.activeCaption);		
		add(erdikoa, BorderLayout.CENTER);
		erdikoa.setLayout(new GridLayout(9,1));
		
		JPanel xx=new JPanel();
		xx.setBackground(SystemColor.activeCaption);
		erdikoa.add(xx);
		
		JPanel arri = new JPanel();
		arri.setBackground(SystemColor.activeCaption);
		FlowLayout fl_arri = new FlowLayout();
		fl_arri.setHgap(15);
		fl_arri.setVgap(10);
		arri.setLayout(fl_arri);
		hautatu=new JLabel("Faktura zenbakia:");
		hautatu.setFont(new Font("Arial", Font.PLAIN, 14));
		
		arri.add(hautatu);
		erdikoa.add(arri);
		
		comboBox = new JComboBox();
		arri.add(comboBox);
		
		JPanel xxx = new JPanel();
		xxx.setBackground(SystemColor.activeCaption);
		FlowLayout flarri = new FlowLayout();
		flarri.setHgap(15);
		flarri.setVgap(10);
		xxx.setLayout(flarri);
		bilaketa=new JLabel("Bilaketa:");
		bilaketa.setFont(new Font("Arial", Font.PLAIN, 14));
		bil=new JTextField(12);
		bilatu=new JButton("Bilatu",new ImageIcon("Argazkia/ico-lupa.png"));
		bilatu.setVerticalAlignment(SwingConstants.BOTTOM);
		bilatu.setFont(new Font("Arial", Font.PLAIN, 14));

		xxx.add(bilaketa);
		xxx.add(bil);
		xxx.add(bilatu);
		erdikoa.add(xxx);
		
		JPanel erdi = new JPanel();
		erdi.setBackground(SystemColor.activeCaption);
		FlowLayout frri = new FlowLayout();
		frri.setHgap(15);
		frri.setVgap(10);
		erdi.setLayout(frri);
		
		erdi.add(scrollLista);
		erdikoa.add(erdi);
		
		
		
		
		//behekoa
		JPanel behekoa = new JPanel();
		FlowLayout flowLayout = (FlowLayout) behekoa.getLayout();
		flowLayout.setAlignment(FlowLayout.RIGHT);
		behekoa.setBackground(SystemColor.activeCaption);
		atzera= new JButton("Atzera");
		atzera.setHorizontalAlignment(SwingConstants.LEFT);
		atzera.setFont(new Font("Arial", Font.PLAIN, 14));
		behekoa.add(atzera);
		
		add(behekoa, BorderLayout.SOUTH);
			}
}
